

#ifndef Lib_CommSubMicom_h
#define Lib_CommSubMicom_h


#ifdef __COMMSUBMICOM__
#define EXTE
#else
#define EXTE extern
#endif




enum
{
        LQC_FUNC_INIT,
        LQC_FUNC_MODEM_UART_CHK,
        LQC_FUNC_WAIT,
        LQC_FUNC_TUMBLE_CW,
        LQC_FUNC_TUMBLE_CCW,
        LQC_FUNC_WATER_FREQ,
        LQC_FUNC_STEAM_SENSE,
        LQC_FUNC_PRE_VALVE,
        LQC_FUNC_COLD_VALVE,
        LQC_FUNC_HOT_VALVE,
        LQC_FUNC_DRY_VALVE,
        LQC_FUNC_STEAM_VALVE,
        LQC_FUNC_BLEACH_VALVE,
        LQC_FUNC_CIR_PUMP,
        LQC_FUNC_DRAIN_PUMP,
        LQC_FUNC_WASH_HEATER,
        LQC_FUNC_STEAM_HEATER,
        LQC_FUNC_DRY_HEATER,
        LQC_FUNC_LOW_RPM,
        LQC_FUNC_HIGH_RPM,
        LQC_FUNC_HIGH_RPM_N_MODEM_CHK,
        LQC_FUNC_DRY_FAN,
        LQC_FUNC_DRY,
        LQC_FUNC_FINAL_MODEM_CHK,
        LQC_FUNC_AUTO_WAIT,
        LQC_FUNC_VER_HEATER_CIR,
        LQC_FUNC_PRE_COLD_DOUBLE_VALVE,
        LQC_FUNC_HOT_DRY_DOUBLE_VALVE,
        LQC_FUNC_HOT_PRE_DOUBLE_VALVE,
        LQC_FUNC_HOT_STEAM_DOUBLE_VALVE,
        LQC_FUNC_PRE_BLEACH_DOUBLE_VALVE,

        LQC_FUNC_DRY_DRAIN,
        LQC_FUNC_HIFH_RPM_N_CHK_TIME,
        LQC_FUNC_AUTO_LQC_TOUCH_UART_ERROR_CHK,
        LQC_FUNC_END,

        LQC_FUNC_NFC_INIT,
        LQC_FUNC_NFC_MOTOR,
        LQC_FUNC_NFC_PRE_VALVE,
        LQC_FUNC_NFC_HOT_VALVE,
        LQC_FUNC_NFC_DRAIN_PUMP,
        LQC_FUNC_NFC_END,

        LQC_FUNC_STEP_NUM,
};


enum
{
        WI_STATE_POWEROFF,
        WI_STATE_INITIAL,
        WI_STATE_PAUSE,
        WI_STATE_DETETING,
};

#define COMM_MODE_NORMAL	0
#define COMM_MODE_DATA_VIEW	1
#define COMM_MODE_LQC_TEST	2


#define DRAWING_CLOSE   0x04
#define DRAWING_OPEN    0x00


static UINT8 STX = 0;
static UINT8 ETX = 0;


void SET_STX(UINT8);
UINT8 GET_STX(void);


void Comm_DispSetPacket_Normal(UINT8*,UINT8);
void Comm_DispRecvPacket_Normal(UINT8*);
void Comm_OptionSetPacket_Normal(UINT8*,UINT8);
void Comm_OptionRecvPacket_Normal(UINT8*);
void Comm_PCSetPacket_Normal(UINT8*,UINT8);
void Comm_PCRecvPacket_Normal(UINT8*);



UINT16 Uart_CRCMaker(UINT8*, UINT8);
void Uart_CrcPacketEncode(UINT8*, UINT8);



void Comm_SetKeyValue_1(UINT8, UINT8);
void Comm_SetKeyValue_2(UINT8, UINT8);
void Comm_SetKeyValue_3(UINT8, UINT8);
void Comm_SetKeyValue_4(UINT8, UINT8);
void Comm_SetPCOption(UINT8);





UINT8 Comm_Get_ReceiveSTX(void);
UINT8 Comm_Get_KeyValue(void);
UINT8 Comm_Get_KeyCount(void);
void ClearKeyValue(void);


UINT8 Get_DoorState(void);
UINT8 Get_PanelType(void);
UINT8 Get_WifiState(void);
UINT8 Comm_Get_ResultFlash(void);
void Clear_ResultFlash(void);
UINT16* Get_OPTION(void);


#undef  EXTR


#endif